package com.isoftstone.app.controller.delayPayment;

import com.isoftstone.bank.controller.base.BaseController;
import com.isoftstone.common.Tidings;
import com.isoftstone.merchant.entity.payment.Payment;
import com.isoftstone.merchant.service.payment.impl.PaymentServiceImpl;
import com.isoftstone.util.Const;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: zhaojg
 * @Description
 * @Date: Created in 16:55 2017/12/8
 * @Modified by:
 *
 * 待缴费查询接口
 */
@Controller
public class DelayPaymentController extends BaseController{

    @Autowired
    PaymentServiceImpl paymentService;
    /**
     *
     * @param openAccount 中银易商账号
     * @param feeId 缴费编号
     *
     * @return
     */
    @RequestMapping(value="app/admin/QueryDelayPayment",method = RequestMethod.POST)
    @ResponseBody
    public Tidings<Map<String, Object>> queryDelayPaymentList(String openAccount,String feeId){
        Tidings<Map<String, Object>> tidings = new Tidings<Map<String, Object>>();
        Map<String, Object> reMap = new HashMap<String, Object>();
        List<Payment> paymentList = null;
        try {
            paymentList = paymentService.delayPaymentlist(openAccount,feeId);
            reMap.put("paymentList",paymentList);
            tidings.setMsg("查询成功");
            tidings.setStatus(Const.SUCCESS);
            tidings.setT(reMap);
        } catch (Exception e) {
            tidings.setMsg("查询失败");
            tidings.setStatus(Const.ERROR);
            e.printStackTrace();
        }
        return tidings;
    }
}
